Functions for file handling in C Programming